package com.woniu.woniuproject.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.woniuproject.mapper.UserVoMapper;
import com.woniu.woniuproject.vo.UserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 功能描述:<br>
 * 〈〉
 *
 * @author EDZ
 * @create 2020/11/18
 * @since 1.0.0
 */
@Service
public class UserVoService {

    @Autowired
    UserVoMapper userVoMapper ;

    public PageInfo<UserVo> queryUserVoList(int currentPage, int pageSize,
                                            String username,
                                            String userphone,
                                            String name,
                                            int st,
                                            int gr,
                                            int tp
                                            ) {
        //mybatis的查询拦截
        PageHelper.startPage(currentPage,pageSize);
        List<UserVo> lists=userVoMapper.selectUserVoList(username,userphone,name,
                st,gr,tp );
        PageInfo<UserVo> pageInfo=new PageInfo<>(lists);
        return pageInfo;
    }

    public int updateUser(int[] array) {
        return userVoMapper.updateUser(array);
    }

    public int updatedisableUser(int[] array) {
        return userVoMapper.updatedisableUser(array);
    }
}
